by Devin Yang

建立於: 5年前 ( 更新: 5年前 )

本文使用的CentOS 6.2進行,進行重build curl及git過程。
主因是因為作業系統太舊,我想直接由source build最新版本的git。
cat /etc/redhat-release
CentOS release 6.2 (Final)

但進行下方指令時,出現了 SSL connect error的錯誤。
git clone https://github.com/git/git.git

因為舊版的CentOS,所以網路提供的方式..
yum update -y nss curl
的更新方式無效了,
所以..我就自己重Build curl。
先在另一台電腦,clone,最新版本的curl。
git clone https://github.com/curl/curl

依其說明,查看GIT-INFO檔,如何編譯。
我執行
./buildconf
./configure
make

就順順利利的編譯完curl了。接著使用make install直接安裝。
完成後,重試git repo的下載(註: 其實到可以到release下載釋出的版本)
[root@myserver src]# git clone https://github.com/git/git.git
Cloning into 'git'...
remote: Counting objects: 247464, done.
remote: Total 247464 (delta 0), reused 0 (delta 0), pack-reused 247463
Receiving objects: 100% (247464/247464), 90.42 MiB | 1.16 MiB/s, done.
Resolving deltas: 100% (182891/182891), done.
Checking connectivity... done.

順立clone了git的source囉.
進入git的repo資料夾。
依README.md說明,查看INSTALL檔,如何安裝。
$ make configure ;# as yourself
$ ./configure --prefix=/usr ;# as yourself
$ make all doc ;# as yourself
# make install install-doc install-html;# as root

果真,按步施工,保證成功。但我只單純進行如下動作。打了./configure,不設定prefix。
make configure
./configure
make
make install

就搞定囉,但是,發覺,疑版本是rc1版本。
[root@myserver git]# which git
/usr/local/bin/git
[root@myserver git]# git --version
git version 2.18.0.rc1

雖然是RC的版本了,基本上不太會有問題才對,看起來滿正常的..:)
[root@myserver src]# git clone https://github.com/DevinY/dlaravel.git
Cloning into 'dlaravel'...
remote: Counting objects: 1456, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 1456 (delta 27), reused 42 (delta 16), pack-reused 1398
Receiving objects: 100% (1456/1456), 3.03 MiB | 948.00 KiB/s, done.
Resolving deltas: 100% (866/866), done.

想想後,我又重build了2.17.1版了,這次到release處透過wget下載,並解壓縮重build。

簡單的用,
./configure
make
make install
最後畫面如下搞定囉,安裝了2.17.1版啦。
		rm -f "$execdir/$p" && \
		test -z "" && \
		ln "$execdir/git-remote-http" "$execdir/$p" 2>/dev/null || \
		ln -s "git-remote-http" "$execdir/$p" 2>/dev/null || \
		cp "$execdir/git-remote-http" "$execdir/$p" || exit; \
	done && \
	./check_bindir "z$bindir" "z$execdir" "$bindir/git-add"
[root@myserver git-2.17.1]# which git
/usr/local/bin/git
[root@myserver git-2.17.1]# git --version
git version 2.17.1
[root@myserver git-2.17.1]#
以上即是這次我在舊版本CentOS 6.2更新git的過程。
 

Tags: linux

Devin Yang

文章內容無法一一說明,如果您有什麼不了解處,歡迎提問哦:)

No Comment

Post your comment

需要登入才可留言!

類似的文章


linux,macos

ps aux你會了嗎?

對於Linux的系統管理者來說肯定要看懂ps aux指令,如果你想成為一個Linux系統管理者,或是你是一個Linux的使用者,都應該都要看的懂這個指令ps就是process status的簡稱,系統上跑了什麼樣的程式,狀態如何執行的身份是誰都可以透過這個指令查出來。看到一些不該出現的程式,可能系統被入侵,被來挖礦了🥹

linux,system

檢測系統中的selinux是否啟用

檢測系統中的selinux是否啟用

linux

如何安裝monitor工具htop到CentOS上

Htop是一個基於Linux的免費(GPL)基於ncurses的程序monitor工具。 他類似於top,但允許您垂直和水平滾動,所以您可以看到運行在系統完整的命令行, 以及可將它們視為程序樹,選擇多個程序並進行操作。